package com.xlh.dto.system;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.xlh.enums.SystemConfigEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * key value 形式的结果集
 * <p>
 * Created by lx on 2019/1/28.
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ValueDTO {

    @ApiModelProperty(value = "id")
    private Integer id;

    @JsonIgnore
    @ApiModelProperty(value = "关键字")
    private String keyWord;

    @ApiModelProperty(value = "值")
    private String keyValue;

    @ApiModelProperty(value = "值的转换地址")
    private String keyValuePath;

    public String getKeyValuePath() {
        return SystemConfigEnum.getByKey(keyWord).getMappingUrl(keyValue);
    }
}
